package Thread;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo3 {
    public static void main(String[] args) {
        //创建固定值为10的线程池
        ExecutorService pool1=Executors.newFixedThreadPool(10);
        //创建缓存线程池，长度为“int的最大值”
        ExecutorService pool2=Executors.newCachedThreadPool();
        //创建单个线程池，只有一个线程
        ExecutorService pool3=Executors.newSingleThreadExecutor();
        //创建一个定时任务线程池，长度为动态增长
        ExecutorService pool4=Executors.newScheduledThreadPool(10);
    }
}
